package com.terren.spider.db.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Service;

import com.terren.spider.db.basic.BasicServiceSupportImpl;
import com.terren.spider.db.service.SpiderKeywordService;
import com.terren.spider.entity.core.SpiderKeyword;

@Service("spiderKeywordService")
public class SpiderKeywordServiceImpl extends BasicServiceSupportImpl implements SpiderKeywordService{
	private final String SQL_MAPPER = "spiderKeywordMapper.";

	@Override
	public void save(List<SpiderKeyword> params) throws Exception {
		basicDao.save(SQL_MAPPER+"addSpiderKeyword", params);
		
	}

	@Override
	public void updateDoneStatus(List<SpiderKeyword> params) throws Exception {
		basicDao.save(SQL_MAPPER + "updateDoneStatus", params);
		
	}

	@Override
	public void updateFetchtimes(List<SpiderKeyword> params) throws Exception {
		basicDao.save(SQL_MAPPER + "updateFetchtimes", params);
		
	}

	@Override
	public List<SpiderKeyword> getKeywords(SpiderKeyword param) throws Exception {
		return basicDao.findForList(SQL_MAPPER + "getSpiderKeywords", param);
	}

	@Override
	public void updateProgressStatus(List<SpiderKeyword> params) throws Exception {
		basicDao.save(SQL_MAPPER + "updateProgressStatus", params);
		
	}

	@Override
	public void updateDoneStatus(SpiderKeyword param) throws Exception {
		// TODO Auto-generated method stub
		List<SpiderKeyword> params = new ArrayList<>();
		params.add(param);
		updateDoneStatus(params);
	}

	@Override
	public void updateFetchtimes(SpiderKeyword param) throws Exception {
		// TODO Auto-generated method stub
		List<SpiderKeyword> params = new ArrayList<>();
		params.add(param);
		updateFetchtimes(params);
	}

	@Override
	public void updateProgressStatus(SpiderKeyword param) throws Exception {
		// TODO Auto-generated method stub
		List<SpiderKeyword> params = new ArrayList<>();
		params.add(param);
		updateProgressStatus(params);
	}
	
	
}
